package org.example.route.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.route.model.dto.ProvinceQueryDTO;
import org.example.route.model.pojo.Province;
import org.example.route.model.vo.ProvinceVO;

import java.util.List;

@Mapper
public interface ProvinceMapper {
    @Select("select name from province where id = #{provinceId}")
    String getProvinceNameById(Long provinceId);


    List<Province> list(ProvinceQueryDTO provinceQueryDTO);

    @Insert("insert into province (name) values (#{name})")
    void add(Province province);

    @Select("select * from province where id = #{id}")
    Province getById(long id);

    @Delete("delete from province where id = #{id}")
    void deleteById(Long id);
}
